<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <table>
        <thead>
            <tr>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th>分数</th>
            </tr>
        </thead>
        <tbody id="tb">
           
        </tbody>
    </table>

    <script>


        // 给的数据
        var data = [
            ['张三' , '男' , 18 , 59] ,
            ['张三' , '女' , 28 , 89] ,
            ['王五' , '男' , 18 , 59] ,
            ['张三' , '男' , 18 , 59] ,
            ['张三' , '男' , 18 , 59] ,
            ['张三' , '男' , 18 , 59] 
        ]


        var html = '' ;
        // tr的行数就是数组的长度
        for(var i = 0 ; i < data.length ; i++) {
            html += '<tr>'
            // tr里面有多个td
            for(var j = 0 ; j < data[i].length ; j++) {
                html += '<td>' + data[i][j] + '</td>'
            }
            html += '</tr>'
        }

        console.log(html);


        var oTb = document.getElementById('tb') ;
        oTb.innerHTML = html ;


    </script>
    
</body>
</html>